package com.chb.iterator;

/**
 * @author chihb
 * @create-time 2024/10/24 17:03
 * @description
 */
public class Test {
    public static void main(String[] args) {
        StudentList studentList = new StudentListImpl();
        studentList.addStudent(new Student("chihb", 20));
        studentList.addStudent(new Student("hong", 21));
        studentList.addStudent(new Student("libai", 22));
        StudentIterator studentIterator = studentList.getIterator();
        while(studentIterator.hasNext()){
            System.out.println(studentIterator.next());
        }
    }
}
